<?php 
use \Workerman\Worker;
use \Workerman\WebServer;
use \GatewayWorker\Gateway;
use \GatewayWorker\BusinessWorker;
use \Workerman\Autoloader;
$context = array(
    'ssl' => array(
        'local_cert'  => '/www/wwwroot/hd2/ssl/full_chain.pem',
        'local_pk'    => '/www/wwwroot/hd2/ssl/private.key',
        'verify_peer' => false,
    )
);
//$gateway = new Gateway("websocket://0.0.0.0:7273", $context);
//$gateway->transport = 'ssl';
// $gateway->transport = 'udp';
$gateway = new Gateway("websocket://0.0.0.0:9527");
$gateway->name = 'Chat';
$gateway->count = 8;
$gateway->lanIp = '127.0.0.1'; 
$gateway->startPort = 2300;
$gateway->registerAddress = '127.0.0.1:1236';
$gateway->pingInterval = 55;
$gateway->pingNotResponseLimit = 1;
$gateway->pingData = '';

//防盗设置
/*$gateway->onConnect = function($connection){
    $connection->onWebSocketConnect = function($connection , $http_header){
        if($_SERVER['HTTP_ORIGIN']=='http://mibo.juxianchang.com'){
		}else{
			$connection->close();
        }
    };
};*/
if(!defined('GLOBAL_START')) {
    Worker::runAll();
}

